import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

const state = {
  path:[], //面包屑
  tab:[],  //tab切换
  currentCode:"",
  creentTab:"",
}


const actions = {

}

const mutations = {
  setPath(state,obj) {
    if(Object.prototype.toString.call(obj).indexOf('Array') > -1) {
      state.path = obj
    }
  },

  setCurrentCode(state, code) {
    state.currentCode = code
  },

  setTab(state, tabParam) {
    state.tab = tabParam
  },

  setTabCur(state, switchTab) {
    state.creentTab = switchTab
  }
}


const getters = {
}


export default new Vuex.Store({
  state,
  actions,
  getters,
  mutations
})
